package util;

import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

public class DateHelper implements Serializable {

	private static final long serialVersionUID = 1L;
	private GregorianCalendar calendar;

	public String toString() {
		return "" 
			+ calendar.get(Calendar.DAY_OF_MONTH)
			+ "/"
			+ (calendar.get(Calendar.MONTH)+1)
			+ "/"
			+ calendar.get(Calendar.YEAR)
			+ " "
			+ calendar.get(Calendar.HOUR_OF_DAY)
			+ ":"
			+ calendar.get(Calendar.MINUTE)
			;
	}

	public DateHelper() {
		this.calendar = new GregorianCalendar();
	}

	public DateHelper(int year, int month, int dayOfMonth, int hourOfDay, int minute) {
		this.calendar = new GregorianCalendar(year, month-1, dayOfMonth,
				hourOfDay, minute, 00);
	}

	public DateHelper(Date date) {
		this.calendar = new GregorianCalendar();
		this.calendar.setTime(date);
	}
	
	public Date getDate() {
		Date date = calendar.getTime(); 
		return date;
	}
	
}
